//
//  FSCClassRoomCell.swift
//  FamiliesSchoolConnection
//
//  Created by 花花蔡 on 2016/12/28.
//  Copyright © 2016年 com.HuaHuaCai. All rights reserved.
//

import UIKit

class FSCClassRoomCell: UITableViewCell {

        
    @IBOutlet weak var classRoomV: UIImageView!
    
    @IBOutlet weak var textNameL: UILabel!
    
    @IBOutlet weak var objectName: UIButton!
    
    @IBOutlet weak var teacherName: UILabel!
    
    @IBOutlet weak var timeL: UILabel!
    
    var model:FSCClassRoomModel? {
        
        didSet{
            guard let model = model else {
                return
            }
//            if model.path != "" {
//                let urlStr =  "http://120.24.57.38/new/zao/" + (model.path ?? "")
//                classRoomV.setImageWith(URL(string: urlStr)!)
//            }else {
                if model.usersex == "女" {
                    classRoomV.image = UIImage(named:"tgirl")
                }else {
                    classRoomV.image = UIImage(named: "tboy")
                }
            timeL.text = model.creattime
            objectName.setTitle(model.course, for: .normal)
            teacherName.text = model.createName
            textNameL.text = model.picgroupname
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        setupUI()
        
}

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func setupUI() -> Void {
        objectName.layer.cornerRadius = 5
        objectName.layer.borderWidth = 1
        objectName.layer.borderColor = UIColor.colorWithHex(hexColor:blueColor).cgColor
        objectName.setTitleColor(UIColor.colorWithHex(hexColor: blueColor), for: .normal)
        classRoomV.layer.cornerRadius = 30
        classRoomV.layer.masksToBounds = true

    }
    
}
